import tensorflow as tf;

async function loadModel() {
  const modelUrl = '/models';
  const modelPath = tf.keras.utils.getFileFromUrl(
    modelUrl,
    modelUrl,
    (err) => {
      if (err) {
        throw err;
      }
    },
    (path) => {
      const model = await tf.loadSavedModel(path);
      return model;
    }
  );

  return modelPath;
}

loadModel().then((model) => {
  console.log('Model loaded:', model);
});
